---召唤物移动
---@class SummonMoveAction:AbstractLeaf
local SummonMoveAction = ClientFight.CreateClass("SummonMoveAction",ClientFight.AbstractLeaf,ClientFight.IAction)
function SummonMoveAction:update()
    if FighterStateEnum.is(self.fighter,FighterStateEnum.CAN_NOT_MOVE) then
       SkillRoleMgr.savePathFile( "[" .. fight.frame .. "][移动]失败" .. fighter);
        return EStatus.SUCCESS
    end
    --移动的战报在外面赋值
    self:move(self.fighter.movePosition)
    return nil
end
--移动
--     * TODO: 2020/11/23 wangjunhui  暂时只支持固定目标点移动 往目标移动可以用moveAction 后续看需求需不需要在这里实现
function SummonMoveAction:move(targetPos)
    local distance =  DistanceUtil.countDistance(self.fighter.position, targetPos)
    local moved = FighterManager.getFighterMoveSpeed(self.fighter)
    if distance <= moved then
        FighterManager.changePosition(self.fight, self.fighter, 0, targetPos.x,targetPos.y, 0, false, true)
        return
    end
    local x = targetPos.x - self.fighter.position.x
    local y = targetPos.y - self.fighter.position.y
    FighterManager.changePosition(self.fight, self.fighter, 0, self.fighter.position.x + (x * moved / distance),self.fighter.position.y + (y * moved / distance), 0, false, true);
end